import Vue from 'vue'
import VueRouter from "vue-router"

import Layout from "@/views/Layout";
import Home from "@/views/Home";
import Play from "@/views/Play";
import Search from "@/views/Search";


//定义路由规则
Vue.use(VueRouter);
const routes = [{
    path: '/',
    redirect: '/Layout'
}, {
    path: '/Layout',
    component: Layout,
    redirect: '/Layout/Home',
    children: [{
        path: 'Home',
        component: Home,
        meta: { title: '首页' }
    }, {
        path: 'Search',
        component: Search,
        meta: { title: '搜索' }
    }]
}, {
    path: '/Play',
    component: Play,
}];


const router = new VueRouter({
    routes: routes,
})

export default router;